/*
 * definitions.h
 *
 *  Created on: Oct 19, 2012
 *      Author: johnny
 */

#ifndef DEFINITIONS_H_
#define DEFINITIONS_H_

#include <list>
#include <boost/shared_ptr.hpp>

namespace measurement {
    struct MeasurementObject;
    class MeasBase;
}

namespace core {

typedef std::list< boost::shared_ptr<measurement::MeasurementObject> > MOStorage;
typedef std::list< boost::shared_ptr<measurement::MeasBase> > MeasBaseStorage;

struct DataPackage {
	enum CycleState {
		cycle_start,
		cycle_body,
		cycle_stop
	};

    DataPackage():  cycleType(DataPackage::cycle_start), cycleID(0), cycleCnt(0),
                    timestamp(0), dataLength(0), data(0) {

    }

    virtual ~DataPackage() {
        if(data != 0)
            delete data;
    }

	CycleState 			cycleType;
	unsigned char 		cycleID;
	unsigned char 		cycleCnt;
	unsigned long 		timestamp;
	unsigned int 		dataLength;
    unsigned char*      data;
};

enum ErrorType {
    Warning, Error, Information,
    Alert, Debug
};

}
#endif /* DEFINITIONS_H_ */
